import React, {Component} from 'react';

class Cart extends Component {
    constructor(props) {
        super(props);
        console.log(this.props.location.state)
        this.state={}

    }
    render() {
        return (
            <div>
                <h2>购物车组件</h2>
            {/*    获取state传递的值,通过this.props.location.state*/}
                <h2>{this.props.location.state.name}学校:{this.props.location.state.school}</h2>
            </div>
        );
    }
}

export default Cart;